<template>
  <div class="page-component-box">
    <el-pagination
      @size-change="pageSizeChange"
      @current-change="pageChange"
      :current-page.sync="pages.page"
      :page-sizes="[5,10, 15]"
      background
      :layout="layout"
      :total="total"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    pages: {
      type: Object,
      default: () => {
        return {};
      }
    },
    total: {
      type: Number,
      default: 0
    },
    layout: {
      type: String,
      default: "prev, pager, next, sizes,jumper"
    }
  },
  methods: {
    pageSizeChange(val) {
      this.$emit("pageSizeChange", val);
    },
    pageChange(val) {
      this.$emit("pageChange", val);
    }
  }
};
</script>

<style lang="scss" scoped>
.page-component-box {
  margin-top: 20px;
  text-align: center;
}
</style>
